Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#798) Add AnchorJS anchors to list items #799

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

st3phhays
Copy link
Member

@st3phhays st3phhays commented Jul 28, 2023

Description Of Changes

This adds anchors to list items that contain a <strong> or a <code>
node directly after an opening <li> tag. This is to make it easier to
navigate to these items, as often times this format is used more as a
"definition", or something we'd want to potentially link to.

No changes to current markdown is needed, as this intended to just
"work". All changes for this functionality live in choco-theme and will
be documented in the Choco Design System.

Motivation and Context

This feature came to mind while putting together the new Jargon page. It would be nice to be able to link others to specific list items that serve more as "definitions".

Testing

  • I have previewed these changes using the Docker Container or another method before submitting this pull request.
  1. Run this PR
  2. Go to http://localhost:5080/en-us/configuration
  3. Hover over the list items that contain code as the first item. Notice that a blue "link" icon appears (like it does in headers). Clicking the icon adds the text that inside of the <code> onto the url, so that it can be navigated to.
  4. On the same page, scroll down to where there are checkboxes in front of the first <code> item. The functionality should work the same as in the step above.
  5. Now go to http://localhost:5080/en-us/getting-started
  6. Hover over any list items that contain a <strong> tag as the first item in the list. The functionality should be the same as in step 3.
  7. In general, only list items that begin with a <code> tag or a <strong> tag get anchor links, and the anchor link should contain the text inside of said tag (not the entire contents of the list item itself).

Change Types Made

  • Minor documentation fix (typos etc.).
  • Major documentation change (refactoring, reformatting or adding documentation to existing page).
  • New documentation page added.
  • The change I have made should have a video added, and I have raised an issue for this.

Change Checklist

  • Requires a change to menu structure (top or left hand side)/
  • Menu structure has been updated

Related Issue

This issue and tags are synced with choco-theme and will be closed in choco-theme once all related issues have been resolved. Please do not close the issue or update tags on this repository.

@st3phhays st3phhays self-assigned this Jul 28, 2023
@st3phhays st3phhays marked this pull request as draft July 28, 2023 14:26
@st3phhays
Copy link
Member Author

This is only in draft because it is linked choco-theme to GitHub for testing purposes. Once choco-theme is merged, it will be updated here, and then this can be taken out of draft.

@st3phhays st3phhays force-pushed the anchors branch 2 times, most recently from f295836 to 787785d Compare July 31, 2023 17:30
@st3phhays st3phhays requested a review from corbob July 31, 2023 17:31
This adds anchors to list items that contain a <strong> or a <code>
node directly after an opening <li> tag. This is to make it easier to
navigate to these items, as often times this format is used more as a
"definition", or something we'd want to potentially link to.

No changes to current markdown is needed, as this intended to just
"work". All changes for this functionality live in choco-theme and will
be documented in the Choco Design System.
@st3phhays st3phhays marked this pull request as ready for review August 1, 2023 13:01
@st3phhays
Copy link
Member Author

@corbob I've updated the choco-theme version here, so this should be good to go now.

@corbob corbob merged commit e17a3c1 into chocolatey:master Aug 1, 2023
1 check passed
@corbob
Copy link
Member

corbob commented Aug 1, 2023

Thanks for getting this added @st3phhays

choco-bot pushed a commit that referenced this pull request Aug 1, 2023
Merge pull request #799 from st3phhays/anchors

(#798) Add AnchorJS anchors to list items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants